package com.tuozixuan;

import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.Expression;

public class AviatorCompileCacheDemo {

	public static void main(String[] args) {
		
		String expression = "2>1";
		Expression compiledExp = AviatorEvaluator.compile(expression, true); // 缓存本次的编译结果
		Boolean result = (Boolean)compiledExp.execute();
		System.out.println(result);
		
		// 使缓存失效
		AviatorEvaluator.invalidateCache(expression);
	}

}
